#include<stdio.h>
#include<assert.h>

char* my_strncpy(char* dest, const  char* src, size_t  num)
{
	assert(dest && src);
	char* ret = dest;

	while (num && *src)
	{
		*dest++ = *src++;
		num--;
	}
	while (num > 0)
	{
		*dest++ = '\0';
	}
	return ret;
}

int main()
{

	char s1[20] = "ABC";
	char s2[20] = "";
	printf("%s", my_strncpy(s2, s1, 2));

	return 0;
}